package com.test.eventbus;

import com.google.common.eventbus.AllowConcurrentEvents;
import com.google.common.eventbus.Subscribe;

public class FirstSubScriber {

    private BizTask bizTask;

    @Subscribe
    @AllowConcurrentEvents
    public void test(EventObject object) {
//        int i = 100;
//        System.out.println(String.format("first setest [%s]", i));
        System.out.println(String.format("FirstSubScriber.test => ThreadId = [%s]", Thread.currentThread().getId()));
        bizTask.doTask();
    }

    @Subscribe
    @AllowConcurrentEvents
    public void handleFirstEvent(FirstEvent firstEvent) throws Exception {
        System.out.println(String.format("FirstSubScriber.handleFirstEvent => ThreadId = [%s]", Thread.currentThread().getId()));
    }

    public BizTask getBizTask() {
        return bizTask;
    }

    public void setBizTask(BizTask bizTask) {
        this.bizTask = bizTask;
    }

}
